package com.hk.login;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hk.action.Action;
import com.hk.action.ActionForward;
import com.hk.dtos.UserDto;
import com.hk.service.LoginService;

public class CheckIdAction implements Action {
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		ActionForward forword=new ActionForward();

		String id = request.getParameter("id");
		LoginService service = LoginService.getInstance();
		UserDto re = new UserDto(); 

		re = service.login(id); 
		if(re!=null){
			forword.setUrl("noid");
			forword.setRedirect(false);
			return forword;	
			
		}
			forword.setUrl("okid");
			forword.setRedirect(false);
	
	
		return forword;	
	}
	
}
